/*************************************************************************
	> File Name: oj-194_find_x_p_y_e_s.c
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年10月26日 星期一 15时13分44秒
 ************************************************************************/

#include <stdio.h>
#include <stdlib.h>

int bs(int *a, int id, int x) {
    int l = 0, r = id, t = a[id], mid;
    while (l <= r) {
        mid = (l + r) / 2;
        if (a[mid] + t == x) return 1;
        if (a[mid] + t < x) l = mid + 1;
        if (a[mid] + t > x) r = mid - 1;
    }
    return 0;
}

int main() {
    int n, s;
    scanf("%d", &n);
    int *a = (int *)malloc(sizeof(int) * n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
    }
    scanf("%d", &s);
    if (a[0] + a[1] > s || a[n - 1] + a [n - 2] < s) {
        printf("NO");
        return 0;
    }
    int last_id, f = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] < s) continue;
        else last_id = i - 1;
    }
    if (a[0] + a[1] == s) f = 1;
    while (last_id > 1 && f != 1) {
        f = bs(a, last_id--, s);
    }
    printf("%s", f ? "YES" : "NO");
    free(a);
    return 0;
}
